<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      for (var i = 1; i <= 100; i++) {
        if (i == 1) {
          console.log('当前是第1次');
        } else if (i == 100) {
          console.log('当前是第100次');
        }
      }
    </script>
  </body>
</html>